<?php

/**
 * SiswaOrangTuaWali filter form base class.
 *
 * @package    alazhar
 * @subpackage filter
 * @author     Ardhy Widodo
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseSiswaOrangTuaWaliFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'hubungan'          => new sfWidgetFormChoice(array('choices' => array('' => '', 'AYAH KANDUNG' => 'AYAH KANDUNG', 'IBU KANDUNG' => 'IBU KANDUNG', 'AYAH ANGKAT' => 'AYAH ANGKAT', 'IBU ANGKAT' => 'IBU ANGKAT', 'WALI' => 'WALI'))),
      'keterangan_wali'   => new sfWidgetFormFilterInput(),
      'created_at'        => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'        => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'hubungan'          => new sfValidatorChoice(array('required' => false, 'choices' => array('AYAH KANDUNG' => 'AYAH KANDUNG', 'IBU KANDUNG' => 'IBU KANDUNG', 'AYAH ANGKAT' => 'AYAH ANGKAT', 'IBU ANGKAT' => 'IBU ANGKAT', 'WALI' => 'WALI'))),
      'keterangan_wali'   => new sfValidatorPass(array('required' => false)),
      'created_at'        => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'        => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('siswa_orang_tua_wali_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'SiswaOrangTuaWali';
  }

  public function getFields()
  {
    return array(
      'siswa_id'          => 'Number',
      'orang_tua_wali_id' => 'Number',
      'hubungan'          => 'Enum',
      'keterangan_wali'   => 'Text',
      'created_at'        => 'Date',
      'updated_at'        => 'Date',
    );
  }
}
